<?php
/* @var $this CountAdminController */
/* @var $model CountAdmin */

$this->breadcrumbs=array(
	'Count Admins'=>array('index'),
	'Create',
);

$this->menu=array(
    array('label'=>'统计', 'url'=>array('admin')),
    array('label'=>'最近20天', 'url'=>array('countDay')),
    array('label'=>'最近12个月', 'url'=>array('countYear')),
    array('label'=>'手动统计', 'url'=>array('countpage')),
);
?>
<script type='text/javascript' src='<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.js'></script>
<script type="text/javascript">
  $(document).ready(function() { 
    $('#subButton').click(function(){  
        if($('#day').val()==""){
            $('iframe').attr('src',"<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl('countAdmin/count')?>");
        }else{ 
            $('iframe').attr('src',"<?php echo Yii::app()->request->hostInfo.Yii::app()->createUrl('countAdmin/count&day=')?>"+$('#day').val());
        }  
        $('iframe').load();
        return false;
    })
  });
</script>
 
<h1>手动统计</h1> 

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'countadmin-form', 
    'enableAjaxValidation'=>false, 
)); ?>  
 
    <div class="row">
        <?php echo CHtml::label("统计天数",false);  ?>
        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'id'=>'day',
            'name'=>'day',
            'language'=>'zh',
            'options'=>array(
                'maxDate'=>'new Date()',  
                'dateFormat'=>'yy-mm-dd',
                'showAnim'=>'fold',
            ),
            //'value'=>date('Y-m-d', strtotime(date("Y-m-d")." - 1 day")),
            'htmlOptions'=>array(
                'style'=>'height:20px;'
            ),
        )); ?> 
    </div> 
    <div class="row buttons">
        <?php echo CHtml::button('开始统计',array('class'=>'subButton','id'=>'subButton')); ?>
    </div>

<?php $this->endWidget(); ?>
  <iframe src="" width="100%" height="200px" frameborder=1 id="showview"></iframe>
</div><!-- form -->
